﻿<UserControl x:Class="EQual.MainModule.Documents.Views.DocumentsListViewControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:RootLibrary.WPF.Localization;assembly=LocalizeExtension"
    xmlns:Models="clr-namespace:EQual.MainModule" >
             

    <UserControl.Resources >

        <ObjectDataProvider x:Key="DocumentsTypes" ObjectType="{x:Type Models:ProjectsProvider}" MethodName="GetDocumentTypes" />
        <loc:LocalizationConverter  x:Key="BaseLocalizationConverter" />
    </UserControl.Resources>
    <ListView BorderThickness="0" Width="Auto"
                  ItemsSource="{Binding Path=ItemsCollection}" 
                  SelectedItem="{Binding Path=ActiveItem, Mode=TwoWay}"  AlternationCount="2"
                  IsSynchronizedWithCurrentItem="True" AutomationProperties.AutomationId="PositionSummaryGrid">
            <ListView.View>
                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Current positions"
                          >
                <GridViewColumn Header="Id" 
            		DisplayMemberBinding="{Binding Path=Id}" 
            		Width="65"/>
                <GridViewColumn Header="Title"  
                  DisplayMemberBinding="{Binding Path=Title}"
                  Width="65" />

                <GridViewColumn Header="{LocText EQualApplication:ResTexts:DocumentType}">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <ComboBox
                            SelectedValue ="{Binding Type}"                                            
                                           SelectedValuePath="id"
                                           DisplayMemberPath="name"
                                           ItemsSource="{Binding Source={StaticResource DocumentsTypes}}">
                            </ComboBox>
                        </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                </GridView>
            </ListView.View>
        </ListView>
    </UserControl>

